package com.coda.app.controller;

import com.coda.app.service.ApartmentService;
import com.coda.appVo.apartment.ApartmentDetailVo;
import com.coda.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/app/apartment")
@Api(tags = "公寓信息")
public class ApartmentController {

    @Autowired
    private ApartmentService apartmentService;
    /**
     * 根据id查询公寓详细信息
     */
    @GetMapping("/getDetailById")
    @ApiOperation("根据id查询公寓详细信息")
    public Result<ApartmentDetailVo> getDetailById(@RequestParam Long id){
        ApartmentDetailVo apartmentDetailVo= apartmentService.getDetailById(id);
        return Result.ok(apartmentDetailVo);
    }
}
